class RequestAuthor < ActionMailer::Base
  def request(user_,comment_=nil)
    @subject    = 'Fieldtrip - author request'
    @body       = {"user" => user_ ,"comment" => comment_}
    admins = User.find_all_by_user_type_id(UserType::ADMINISTRATOR[:id])
    if admins.size > 0
      @recipients = admins.collect{|a| a.email}.join(',')
    else
      logger.error('No admin user!!!')
      @recipients = ''
    end
    @from       = 'admin@fieldtrip.llp.pl'
    @sent_on    = Time.now
    @headers    = {}
  end
end